package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        File file = new File("demo.txt");
        System.out.println("文件名："+file.getName());
        long length = file.length();
        System.out.println("文件的字节数："+length);
        boolean cr = file.canRead();
        System.out.println("文件是否可读："+cr);
        boolean cw = file.canWrite();
        System.out.println("文件是否可写："+cw);
        boolean hidden = file.isHidden();
        System.out.println("文件是否隐藏："+hidden);
    }
}
